<!DOCTYPE html>
<html lang="zh-CN">

<head>
  <meta charset="UTF-8">
  <meta name="author" content="wangbo">
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>强制转化</title>
</head>

<body>
  <script>

    // 字符串 "" ''  反引号 `` 空字符串' '  
    let str = `null`
    let str1 = `10`
    let num = 10;
    let str2 = String(num)
    // 字符串+ 任何类型的数据(除了symbol),
    console.log(typeof str2, str2);
    let str3 = "" + null
    console.log(typeof str3, str3);
    let str4 = String(undefined)
    console.log(typeof str4, str4);
    // Cannot convert a Symbol value to a string
    // let str5 = ''+Symbol()
    // console.log(typeof str5,str5);
    let name = "小明"
    let age = 10
    // 我叫小明我10岁了
    console.log("我叫" + name + "我" + age + "岁了");
    console.log(`我叫${name}我${age}岁了`);
    
  </script>
</body>

</html>